@import '../style/var';

.van-fieldinput {
  &__newwrap {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    box-sizing: border-box;

    &--clearwrap {
      position: relative;
      padding-right: 5px;
    }

    &--focused {
      border-style: solid !important;
      border-color: var(--van-fieldinput-focused-border-color) !important;
      border-width: var(--van-fieldinput-focused-border-width) !important;
    }
  }
  &__control {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0; // for flex-shrink in field__button
    margin: 0;
    padding: 0;
    color: var(--van-fieldinput-text-color);
    line-height: inherit;
    text-align: inherit;
    background-color: transparent;
    border: 0;
    resize: none;

    &::placeholder {
      color: var(--van-fieldinput-placeholder-color);
    }

    &:disabled {
      color: var(--van-fieldinput-disabled-color);
      cursor: not-allowed;
      opacity: 1;
      // fix disabled color in mobile safari
      -webkit-text-fill-color: var(--van-fieldinput-disabled-color);
    }

    &:read-only {
      cursor: default;
    }

    &--center {
      justify-content: center;
      text-align: center;
    }

    &--right {
      justify-content: flex-end;
      text-align: right;
    }

    &--custom {
      display: flex;
      align-items: center;
      min-height: var(--van-fieldinput-line-height);
    }

    &--hide {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    // for ios wechat
    &[type='date'],
    &[type='time'],
    &[type='datetime-local'] {
      min-height: var(--van-fieldinput-line-height);
    }

    // for safari
    &[type='search'] {
      -webkit-appearance: none;
    }
  }

  &__clear {
    flex-shrink: 0;
  }

  &__clear {
    margin-right: -@padding-xs;
    padding: 0 @padding-xs;
    line-height: inherit;
  }

  &__clear {
    color: @field-clear-icon-color;
    font-size: @field-clear-icon-size;
    cursor: pointer;
  }

}

